<?php
/**
 * 订单数据管理模型
 * PHP version 5
 * @package   Antonia
 * @author    Antonia <471699715@qq.com>
 * @copyright 2016 Antonia.
 */
namespace Common\Model;
use Think\Model\RelationModel;
class ConvertModel extends RelationModel {

    protected $tableName = 'convert'; 
    
    /**
     * 设置主键
     *
     * @author Antonia
     */
    protected $pk        = 'id';

    /**
     * 关联
     * @author Antonia
     */
    protected $_link = array(
    	'Gifts' => array( 
            'mapping_type'  => self::HAS_ONE,
            'class_name'    => 'Gifts',
            'foreign_key'   => 'gifts_id',
            'mapping_name'  => 'gift',
            'mapping_fields'   => 'gifts_id,giftName',
        ),
        'Users' => array( 
            'mapping_type'  => self::HAS_ONE,
            'class_name'    => 'Users',
            'foreign_key'   => 'users_id',
            'mapping_name'  => 'user',
            'mapping_fields'   => 'users_id,userName',
        ),
    );
}
?>